/**
 * 
 */
package com.gragra.nounIdentification;
/**
 * this class can be used to wrap an existing MaxAssessment and enforce that some minima are ensured
 * @author Christoph Teichmann
 * created Mar 26, 2013 11:20:03 AM
 * @version 0.1
 */
public class IncreasingMaxWithMin implements MaxAssessment
{
	/**
	 * creates a new instance from the existing MaxAssessment and with the given minimum values
	 * @param ma
	 * @param fMin minimum frames
	 * @param nMin the minimum words
	 */
	public IncreasingMaxWithMin(MaxAssessment ma, int fMin, int wMin)
	{
		this.ma = ma;
		this.fMin = fMin;
		this.wMin = wMin;
	}
	/**
	 * the assessment that is wrapped
	 */
	private final MaxAssessment ma;
	/**
	 * the minimum number of frames
	 */
	private final int fMin;
	/**
	 * the minimum number of words used
	 */
	private final int wMin;
	/* (non-Javadoc)
	 * @see com.gragra.nounIdentification.MaxAssessment#getMaxNouns(int, com.gragra.nounIdentification.BaseNounIdentifier)
	 */
	@Override
	public int getMaxNouns(int iteration, BaseNounIdentifier fixedNounIdentifier)
	{return Math.max(wMin, ma.getMaxNouns(iteration, fixedNounIdentifier));}
	/* (non-Javadoc)
	 * @see com.gragra.nounIdentification.MaxAssessment#getMaxFrames(int, com.gragra.nounIdentification.NounIdentifier)
	 */
	@Override
	public int getMaxFrames(int iteration, NounIdentifier nounIdentifier)
	{return Math.max(fMin, ma.getMaxFrames(iteration, nounIdentifier));}
}